package com.dong.c08_netty_http;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * <h1></h1>
 *
 * @author : dzj
 * @create: 2021-03-08 09:07
 */
public class TestServerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        //向管道添加处理器
        ChannelPipeline pipeline = ch
                .pipeline();
        //编解码
        pipeline.addLast("myHttpServerConde",new HttpServerCodec());
        //2. 自定义
        pipeline.addLast(new TestServerHandler());


    }
}
